<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/view/common/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head>
<title>${appname}-<c:if test="${!empty sessionScope._local_node_session}">${sessionScope._local_node_session.nodeName}-</c:if>${si:ctname("NET_TYPE",sessionScope._netType)}</title>
<%@ include file="/WEB-INF/view/common/css_js_ace.jsp"%>
<script type="text/javascript">
var modal=null;
	$(function() {
		modal= $.scojs_modal({
			target:"#myModal"
		});	
		 $("button[data-dismiss='modal']").click(function(e) {
			 modal.close();
			 location.reload();
			}
		 );
		 initNode();
		if('${msg}' != ''){
			var html = "<div class='alert alert-block alert-warning'>"+'${msg}'+"<a href='${ctx}/registry/node_info_init.do'>刷新</a></div>";
			$('#data').html(html);
			
		}
		$("#sidebar a").bind("click",function(){return false;});
		$("#topbar1 a").each(function() {$(this).replaceWith("<a style='cursor:hand'>"+$(this).html()+"</a>");});
		$("#topbar2 a").each(function() {$(this).replaceWith("<a style='cursor:hand'>"+$(this).html()+"</a>");});
		$("#topbar3 a").each(function() {$(this).replaceWith("<a style='cursor:hand'>"+$(this).html()+"</a>");});
		$("#sidebar button").attr("disabled", "disabled");
		$('#addNodeForm input').tooltip();
		//表单验证
		$('#addNodeForm').checkForm();
		$('#addNodeForm').ajaxForm({
			url : _ctx + "/registry/init_node_info.do",
			type : "post",
			dataType : "json",
			beforeSubmit : function() {
				$("#sbmBtn").attr("disabled", "disabled");
			},
			data: {
				   nodeName:$("#newNodeName").val()
			},
			clearForm : false,
			resetForm : false,
			success : function(resp) {
				if (resp.status == '1') {
					ui.msg(resp.msg, 1);
					ui.go(_ctx + '/registry/node_info_mgr.do');
				} else {
					ui.msg(resp.msg, 0);
				}
				$("#sbmBtn").removeClass("disabled").attr("disabled", null);
			},
			error : function(resp) {
				ui.msg('请求发送失败', 0);
				$("#sbmBtn").removeClass("disabled").attr("disabled", null);
			}
		});
	});
	function initNode(){
		modal.show();
	}
</script>
<body>
<%@ include file="/WEB-INF/view/common/topbar.jsp"%>
<div class="main-container" id="main-container" >
	<div class="main-container-inner" >
		<%@ include file="/WEB-INF/view/common/sidebar.jsp"%>
		<div style="background:black;z-index: 99;">
		<div class="main-content" id="div2" style="z-index:100; background-color:#ffffff;">
			<div class="breadcrumbs" id="breadcrumbs">
					<ul class="breadcrumb">
						<li>
							<i class="icon-home home-icon"></i>
							<a href="#">首页</a>
						</li>
						<li>
							<a href="#">注册管理</a>
						</li>
						<li>
							<a href="#">节点注册</a>
						</li>
						<li class="active">节点初始化</li>
					</ul>
				</div>
				<div class="page-content">
					<div class="row">
											<div id="myModal" class="modal fade" role="dialog" tabindex="-1" style="padding-top: 100px;">
												<div class="modal-dialog">
													<div class="modal-content">
												      	<div class="widget-header">
															<h6 class="smaller">节点初始化</h6>
														</div>
														<div id="data">
															<form class="form-horizontal" role="form" id="addNodeForm" action=""
																method="post">
																<input type="hidden" name="nodeCode" id="nodeCode" value="${nodeCode }"/>
																<div class="space-4"></div>
																<div class="form-group">
																	<div class="col-sm-3 control-label no-padding-right"
																		for="form-field-2">行政区*</div>
																	<div class="col-sm-9" style="padding-top: 7px;">
																		${orgInfo.adNm }
																	</div>
																</div>
																<div class="space-4"></div>
																<div class="form-group">
																	<div class="col-sm-3 control-label no-padding-right"
																		for="form-field-2">节点编码</div>
																	<div class="col-sm-9" style="padding-top: 7px;">
																		${nodeCode }
																	</div>
																</div>
																<div class="space-4"></div>
																<div class="form-group">
																	<div class="col-sm-3 control-label no-padding-right"
																		for="form-field-1">节点名称 *</div>
																	<div class="col-sm-9">
																		<input type="text" class="col-xs-10 col-sm-5" name="newNodeName"
																			id="newNodeName" datatype="require|limit|ajax"  min="2"  max="50"
																			url="${ctx }/registry/is_nodename_unique.do" oldValue=""
																			placeholder="请输入节点名称"
																			msg="请输入节点名称|节点名称长度错误，长度应为[2~50]！|节点名称重复！" title="必填项,节点名称" />
																	</div>
																</div>
																<div class="space-4"></div>
																<div class="form-group">
																	<div class="col-sm-3 control-label no-padding-right"
																		for="form-field-1">管理员邮箱 *</div>
																	<div class="col-sm-9">
																		<input type="text" class="col-xs-10 col-sm-5"  name="adminEmail"
																			id="adminEmail"  datatype="require|email"  placeholder="请输入管理员邮箱 "
																			msg="请输入管理员邮箱 |请输入正确的管理员邮箱"  title="必填项,管理员邮箱 " />
																	</div>
																</div>
																<div class="space-4"></div>
																<div class="form-group">
																	<div class="col-sm-3 control-label no-padding-right"
																		for="form-field-2">访问地址</div>
																	<div class="col-sm-9" style="padding-top: 7px;">
																		<input type="text" class="col-xs-10 col-sm-5"  name="installUrl"
																			id="installUrl"  datatype="require"  placeholder="请输入访问地址 "
																			msg="请输入访问地址"  title="必填项,访问地址" />
																	</div>
																</div>
																<div class="space-4"></div>
																<div class="form-group">
																	<div class="col-sm-2 control-label no-padding-right"
																		for="form-field-1"></div>
																	<div class="col-sm-10">
																	注：此地址为项目公网访问地址,例：http://10.1.1.1:8080/turbo
																	</div>
																</div>
																<div class="space-4"></div>
																<div class="form-group">
																	<div class="col-sm-3 control-label no-padding-right"
																		for="form-field-2">是否有网闸</div>
																	<div class="col-sm-9" style="padding-top: 7px;">
																		${si:yesNoStr(hasGap)}
																	</div>
																</div>
																<div class="space-4"></div>
																<div class="form-group">
																	<div class="col-sm-3 control-label no-padding-right"
																		for="form-field-2">备注</div>
																	<div class="col-sm-9" style="padding-left: 5px;">
																		<textarea class="col-sm-5" placeholder="请输入备注" name="remark"
																			id="remark" title="备注"></textarea>
																	</div>
																</div>
																<hr>
																<div class="modal-footer wizard-actions">
																	<button type="submit" class="btn btn-sm btn-info"  id="sbmBtn"  >
																		<i class="icon-ok bigger-110"></i>提交
																	</button>
																</div>
															</form>
											  			</div>
													</div>
												</div>
											</div>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
</body>
</html>
